package com.jingwei.activiti.config;

import org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class ActivitiDataSourceConfig extends AbstractProcessEngineAutoConfiguration {
    //指定activiti数据源
    @Bean
    public DataSource dataSource() {
        return DataSourceBuilder.create().url("jdbc:mysql://localhost:3306/activiti?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC").username("root")
                .password("lijingwei22").driverClassName("com.mysql.cj.jdbc.Driver").build();
    }

}
